Array.prototype.myMap = function(callback) {
  return this.reduce((acc, curr, index, array) => {
    acc.push(callback(curr, index, array))
    return acc
  }, [])
}
const arr = [1,2,3,4]
console.log(arr.myMap(item => item * 2))